<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>我的简历</title>
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/style.css"/>
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/status.css"/>
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/myresume.css"/>
		<script type="text/javascript" src="Public/uploadify/jquery-1.8.2.min.js"></script>
		<script src="./Public/Home/js/jquery.easing.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="./Public/Home/js/index.js" type="text/javascript" charset="utf-8"></script>
		<script src="./Public/Home/js/myresume.js" type="text/javascript" charset="utf-8"></script>
		<!-- 引入uploadify所需插件 -->
		<script type="text/javascript" src="./Public/uploadify/jquery.uploadify.min.js"></script>
    	<link rel="stylesheet" type="text/css" href="./Public/uploadify/uploadify.css">
    	<script type="text/javascript">
	        $(function() {
	            $('#f').uploadify({
	                'formData'     : {//POST数据
	                    '<?php echo session_name();?>' : '<?php echo session_id();?>',
	                },
	                'fileTypeExts' : '*.jpg;*.png',
	                'swf'      : '{{__PUBLIC__}}/uploadify/uploadify.swf',
	                'uploader' : '{{U('upload')}}',//指定服务器上传的方法
	                'buttonText':'',
	                'fileSizeLimit' : '2000KB',
	                'uploadLimit' : 1,//上传文件数
	                'width':128,
	                'height':128,
	                'successTimeout':10,//等待服务器响应时间
	                'removeTimeout' : 0.2,//成功显示时间
	                'onUploadSuccess' : function(file, data, response) {
	                    //把php返回的数据转为json
	                    data=$.parseJSON(data);
	                    //获得图片地址
	                    var imageUrl = data.url;
	                    var li="<li>";
	                    li += "<img style='width:128px;height:128px;' src='"+imageUrl+"'/>";
	                    li += "<input type='hidden' name='portrait' value='"+data.path+"'/><a href='javascript:;' id='self-close'>X</a>";
	                    li += "</li>";
	                    $("#uploadList ul").prepend(li);
	                }
	            });

				//关闭图片
	            var i = 1;
	            $('#self-close').live('click',function(){
	                $(this).parent('li').remove();
	                i++;
	                $('#f').uploadify('settings','uploadLimit',i);
	                var oldImg=$(this).siblings('input').val();
	                $.ajax({
	                	type:"post",
	                	url:"{{U('delUpload')}}",
	                	data:{oldImg:oldImg},
	                	success:function(data){

	                	}
	                });
	            })
	        });
	    </script>
	</head>
	<body>
	{{include file="../Common/header"}}

	<!--主体部分-->
	<div id="container">
		<div class="center_main">
			<!--左边区域-->
			<div class="myresume_l">
				<!--左侧头部部分-->
				<div class="mr_head">
					<div class="mr_top_bg">
						<img src="{{$data['portrait']?$data['portrait']:'./Public/Home/image/myresume/default_headpic.png'}}" class="default_head" id="topImg" />
						<img src="./Public/Home/image/myresume/tou_1fee.png" class="opa" style="z-index:2;" />
						<img src="./Public/Home/image/myresume/shadow_tx.png" class="shadow"/>
						<input type="file" id="f" multiple="true"/>

					    <div id="uploadList">
					        <ul>

					        </ul>
					    </div>
					</div>
					<div class="mr_baseinfo">
						<i class="mr_left_bg"></i>
						<i class="mr_right_bg"></i>
						<div class="mr_p_name mr_edit_box">
							<span class="mr_edit">
								<i></i><em>编辑</em>
							</span>
							<span class="mr_name">{{$data['truename']?$data['truename']:'（简历姓名）'}}</span>
						</div>
						<form action="javascript:;" id="nameform">
							<div class="mr_name_edit dh">
								<input type="text" name="truename" id="mr_name" class="ed_name" value="{{$data['truename']}}" required maxlength="10" />
								<input type="submit" class="save" value="保存" />
								<a href="javascript:void(0);" class="cancel">取消</a>
							</div>
						</form>
						<!-- 用户名的异步更新 -->
						<script type="text/javascript">
							$(function(){
								$("#nameform").submit(function(){
									//获得表单提交的数据
									var data = $(this).serialize();
									$.ajax({
										type:"post",
										url:"{{U('Resume/editName')}}",
										data:data,
										success:function(phpData){
											if(phpData){
												$("span.mr_name").html($("#mr_name").val());
												$(".mr_name_edit").hide().parent().prev().show();
											}else{
												$(".mr_name_edit").hide().parent().prev().show();
												$("#mr_name").val({{$data['truename']}});
											}
										}
									});
								})
							})
						</script>
						<!-- 用户名的异步更新结束 -->
						<div class="mr_p_introduce mr_edit_box">
							<span class="mr_edit">
								<i></i><em>编辑</em>
							</span>
							<span class="mr_intro">{{$data['introduction']?$data['introduction']:'一句话介绍自己，告诉我为什么选择你而不是别人'}}</span>
						</div>
						<form action="javascript:;" id="introform">
							<div class="mr_intro_edit dh">
								<input type="text" name="introduction" id="mr_intro" class="ed_intro" value="{{$data['introduction']}}" placeholder="一句话介绍自己，告诉我为什么选择你而不是别人" required="required" maxlength="25" />
								<input type="submit" class="save" value="保存" />
								<a href="javascript:void(0);" class="cancel">取消</a>
							</div>
						</form>
						<!-- 个人你介绍异步更新 -->
						<script type="text/javascript">
							$(function(){
								$("#introform").submit(function(){
									//获得表单提交的数据
									var data = $(this).serialize();
									$.ajax({
										type:"post",
										url:"{{U('Resume/editIntro')}}",
										data:data,
										dataType:"JSON",
										success:function(phpData){
											if(phpData){
												$("span.mr_intro").html($("#mr_intro").val());
												$(".mr_intro_edit").hide().parent().prev().show();
											}else{
												$(".mr_intro_edit").hide().parent().prev().show();
												$("#mr_intro").val($("span.mr_intro").html());
											}
										}
									});
								})
							})
						</script>
						<!-- 个人介绍异步更新结束 -->
						<div class="mr_p_info mr_edit_box">
							<div class="info_j">
								<span class="base_info">
									<i></i>
									<em class="sex">{{$data['sex']?$data['sex']:'男'}}</em>
									<em class="age">{{$data['age']?$data['age'].'岁':'请填写年龄'}}</em>
									<em class="edu">{{$data['edu']?$data['edu']:'请选择学历'}}</em>
								</span>
							</div>
							<div class="info_b">
								<span class="mobile">
									<i></i>
									<em title="{{$data['tel']?$data['tel']:'空'}}">{{$data['tel']?$data['tel']:'空'}}</em>
								</span>
								<span class="email">
									<i></i>
									<em title="{{$data['account']}}">{{$data['account']}}</em>
								</span>
							</div>
							<span class="mr_edit">
								<i></i><em>编辑</em>
							</span>
						</div>
						<form action="javascript:;" id="allinfoform">
							<div class="mr_info_edit dh">
								<label>性别</label>
								<input type="hidden" name="sex" value="{{$data['sex']}}" id="sexInput">
								<div class="mr_sex">
									<span class="mr_man <?php if ($data['sex']=='男'): ?> active <?php endif ?>  ">
										<i></i>
										<em>男</em>
									</span>
									<span class="mr_woman <?php if ($data['sex']=='女'): ?> active <?php endif ?> ">
										<i></i>
										<em>女</em>
									</span>
								</div>
								<label>年龄</label>
								<div class="mr_age form_wrap">
									<input type="button" class="mr_button" value="{{$data['age']?$data['age']:'18'}}岁" />
									<input type="hidden" name="age" id="ageInput" value="{{$data['age']?$data['age']:'18'}}">
									<i class="mr_sj"></i>
									<div class="xl_list">
										<ul class="xl_ul" style="max-height:180px;overflow:auto;">
											<li>18岁</li>
											<li>19岁</li>
											<li>20岁</li>
											<li>21岁</li>
											<li>22岁</li>
											<li>23岁</li>
											<li>24岁</li>
											<li>25岁</li>
											<li>26岁</li>
											<li>27岁</li>
											<li>28岁</li>
											<li>29岁</li>
											<li>30岁</li>
											<li>31岁</li>
											<li>32岁</li>
											<li>33岁</li>
											<li>34岁</li>
											<li>35岁</li>
											<li>36岁</li>
											<li>37岁</li>
											<li>38岁</li>
											<li>39岁</li>
											<li>40岁</li>
										</ul>
									</div>
								</div>
								<label>最高学历</label>
								<div class="mr_edu form_wrap">
									<input type="button" class="mr_button" value="{{$data['edu']?$data['edu']:'高中'}}" />
									<input type="hidden" name="edu" id="eduInput" value="{{$data['edu']?$data['edu']:'高中'}}">
									<i class="mr_sj"></i>
									<div class="xl_list">
										<ul class="xl_ul">
											<li>高中</li>
											<li>大专</li>
											<li>本科</li>
											<li>硕士</li>
											<li>博士</li>
										</ul>
									</div>
								</div>
								<label>手机号码</label>
								<div class="mobile_s form_wrap">
									<input type="text" class="mr_mobile" value="{{$data['tel']?$data['tel']:''}}" name="tel" maxlength="11" />
									<i class="mr_locks"></i>
								</div>

								<br />
								<input type="submit" class="save" value="保存" />
								<a href="javascript:void(0);" class="cancel">取消</a>
							</div>
						</form>
						<!-- 综合信息异步更新 -->
						<script type="text/javascript">
							$(function(){
								$("#allinfoform").submit(function(){
									//获得表单提交的数据
									var data=$(this).serialize();
									$.ajax({
										type:"post",
										url:"{{U('Resume/editOthers')}}",
										data:data,
										dataType:"JSON",
										success:function(phpData){
											if(phpData){
												$(".sex").html($("#sexInput").val());
												$(".age").html($("#ageInput").val());
												$(".edu").html($("#eduInput").val());
												$(".mobile em").html($(".mr_mobile").val());
												$(".mr_info_edit").hide().parent().prev().show();
											}else{
												$(".mr_info_edit").hide().parent().prev().show();
												$("#sexInput").val($(".sex").html());
												$("#ageInput").val($(".age").html());
												$("#eduInput").val($(".edu").html());
												$(".mr_mobile").val($(".mobile em").html());
											}
										}
									});
								})
							})
						</script>
						<!-- 综合信息异步更新结束 -->
					</div>
				</div>
				<!--左侧内容部分-->
				<div class="mr_content">
					<div class="mr_self_state">
						<div class="form_wrap active" id="btn_state">
							<input type="button" class="mr_button" value="我目前已离职，可快速到岗" />
							<i class="mr_sj"></i>
							<div class="xl_list">
								<ul class="xl_ul">
									<li>我目前已离职，可快速到岗</li>
									<li>我目前正在职，正考虑换个新环境</li>
									<li>我暂时不想找工作</li>
									<li>我是应届毕业生</li>
								</ul>
							</div>
						</div>
					</div>
				</div>
				<!--左侧底部部分-->
				<div class="mr_bottom">
					<div class="mr_bottom_r">
						<span>简历所属@</span>
						<span>{{$data['username']}}</span>
					</div>
				</div>
			</div>
			<!--左边区域结束-->
			<!--右边区域-->
			<div class="content_r" style="float: right;margin-left: 0;">
				<!--右边顶部导航-->
				<div class="CR_nav">
					<ul>
						<li>
							<a href="status.html">
								投递箱
								<i class="tu"></i>
							</a>
						</li>
						<li>
							<a href="resume.html">
								我的简历
								<i class="jl"></i>
							</a>
						</li>
						<li>
							<a href="collection.html" >
								收藏夹
								<i class="shc"></i>
							</a>
						</li>
						<li class="mr_none">
							<a href="settings.html" >
								个人中心
								<i class="gr"></i>
							</a>
						</li>
					</ul>
				</div>
				<!--上传简历区域-->
				<div class="mr_upload">
					<i></i>
					<span>{{basename($data['resume'])?$data['truename'].'的简历.pdf':'我要上传附件简历'}}</span>
					<input type="file" id="w" multiple="true"/>
					<script type="text/javascript">
				        $(function() {
				            $('#w').uploadify({
				                'formData'     : {//POST数据
				                    '<?php echo session_name();?>' : '<?php echo session_id();?>',
				                },
				                'fileTypeExts' : '*.doc;*.pdf;*.txt',
				                'swf'      : '{{__PUBLIC__}}/uploadify/uploadify.swf',
				                'uploader' : '{{U('upResume')}}',
				                //指定服务器上传的方法
				                'buttonText':'',
				                'fileSizeLimit' : '2000KB',
				                'uploadLimit' : 1,//上传文件数
				                'width':242,
				                'height':57,
				                'successTimeout':10,//等待服务器响应时间
				                'removeTimeout' : 0.2,//成功显示时间
				                'onUploadSuccess' : function(file, data, response) {
				                    //把php返回的数据转为json
				                    data=$.parseJSON(data);
				                    //获得文件地址
				                    var resumeUrl = data.url;
				                    var resumeName = resumeUrl.substring(resumeUrl.lastIndexOf('/')+1);
				                	$(".mr_upload span").html(resumeName);
				                    var li="<input type='hidden' name='resume' value='"+data.path+"'/><a href='javascript:;' id='selfclose'>X</a>";
				                    $(".mr_upload").prepend(li);
				                }
				            });

							//删除上传简历
				            var i = 1;
				            $('#selfclose').live('click',function(){
				                i++;
				                $('#w').uploadify('settings','uploadLimit',i);
				                var oldResume=$(this).siblings('input').val();
				                $.ajax({
				                	type:"post",
				                	url:"{{U('delResume')}}",
				                	data:{oldResume:oldResume},
				                	dataType:"JSON",
				                	success:function(data){
				                		if(data){
				                			$(".mr_upload span").html('我要上传附件简历');
				                			$(".mr_upload input,.mr_upload a").remove();
				                		}
				                	}
				                });
				            })
				        });
				    </script>
				</div>
			</div>
			<!--右边区域结束-->
		</div>
	</div>






	<!--主体部分结束-->


	<div style="height: 500px;"></div>



	<!--回到顶部-->
	<a href="javascript:void(0);" id="back"></a>
	<!--回到顶部结束-->


	{{include file="../Common/footer"}}














	</body>
</html>

















